package org.niit.app

import org.apache.spark.SparkConf
import org.apache.spark.streaming.dstream.DStream
import org.niit.bean.AdClickData
import org.niit.common.TApp
import org.niit.controller.{AreaDataController, UserDataController}
import org.niit.handler.DataHandler

/**
 * Date:2025/5/29
 * Author：Ys
 * Description:
 */
object AdRealTimeApp extends TApp  {

   start("local[*]","AdApp"){
      val userDataController = new UserDataController()
      val areaDataController = new AreaDataController()

      //利用封装好的DataHandler获取并切割（处理）数据
      val value: DStream[AdClickData] = DataHandler.KafkaDataHandler("BD2", "AD2")

      userDataController.dispatch(value)
      areaDataController.dispatch(value)


      // 启动 start和 awaitTermination封装在一起了
      DataHandler.startAndAwait()
   }


}
